package com.sun.hilt;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import javax.inject.Inject;

import dagger.hilt.android.AndroidEntryPoint;

@AndroidEntryPoint
public class MainActivity extends AppCompatActivity{

    @Inject
    public Truck truck;//使用注解获取truck对象

    @Inject
    public Driver driver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


//        Truck truck = new Truck();
        truck.addCargo(new Computer("zhang san"));
        truck.addCargo(new Computer("Li si"));
//        truck.deliver();
        truck.deliverReal();
    }
}